﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EASendMail;


public partial class SendFeedBack : System.Web.UI.Page
{

    
   public void Page_Load(object sender, EventArgs e)
    {
        //ParentName.Text = null;
        //PhoneNum.Text = null;
        //KidName.Text = null;
        //ComplanetTxt.Text = null;

    }
  public void Button1_Click(object sender, EventArgs e)
    {
        
        string Parent_Name = this.ParentName.Text;
        string ParentPhone = this.PhoneNum.Text;
        string Kid_Name = this.KidName.Text;
        string ParentComplanet = this.ComplanetTxt.Text;

        //if ((Parent_Name != null) || (Kid_Name != null) || (ParentPhone != null) || (ParentComplanet != null))
        //{
            SmtpMail oMail = new SmtpMail("TryIt");
            SmtpClient oSmtp = new SmtpClient();

            // Your gmail email address
            oMail.From = "aadelelkotamy510@gmail.com";

            // Set recipient email address
            oMail.To = "aadelelkotamy@yahoo.com";

            // Set email subject
            oMail.Subject = "Complanet";

            // Set email body
            oMail.TextBody = "Parent Name   " + ParentName.Text + "     Parent Phone    " + PhoneNum.Text + "   Parent Complanet   " + ComplanetTxt.Text + "   Kid Name   " + KidName.Text + "";

            // Gmail SMTP server address
            SmtpServer oServer = new SmtpServer("smtp.gmail.com");

            // Set 25 port, if you want to use 587 port, please change 25 5o 587
            oServer.Port = 587;

            // detect SSL/TLS automatically
            oServer.ConnectType = SmtpConnectType.ConnectSSLAuto;

            // Gmail user authentication
            // For example: your email is "gmailid@gmail.com", then the user should be the same
            oServer.User = "aadelelkotamy510@gmail.com";
            oServer.Password = "26248055";

            oSmtp.SendMail(oServer, oMail);

        //}
        //else
        //{
        //    Response.Redirect("gamezeropage.aspx.cs");
        //  }
    }
    protected void TextBox2_TextChanged(object sender, EventArgs e)
    {

    }
}